package carTest;

/**
 * @description:
 * @author: 张德长 dechang.zhang@ucarinc.com
 * @date: 11:32:23 2018/11/1
 * @version:2.0
 */
public class RequestPara {

    public long id;
    public long parentId;
    public String dataType;
    public int level;
    public String name;
    public String isMust;
    public int type;
    public String identifier;

    public String dataTypeChange(String dataType) {
        if(dataType==null){return dataType;}
        String[] splitStr = dataType.split(":");
        String first = splitStr[0];
        if ("List".equals(first)) {
            first = "Array";
        } else if ("Date".equals(first)) {
            first = "String";
        }
        if (splitStr.length == 2) {
            dataType = first + ":"+splitStr[1];
        }
        return dataType;
    }

    public void rpc2HttpPara() {
        this.dataType = dataTypeChange(this.dataType);
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getParentId() {
        return parentId;
    }

    public void setParentId(long parentId) {
        this.parentId = parentId;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIsMust() {
        return isMust;
    }

    public void setIsMust(String isMust) {
        this.isMust = isMust;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }
}
